Docs changes workflow#144
Conversation
|
This pull request introduces a new reusable GitHub Actions workflow, In addition to the new workflow, this PR includes a significant effort to improve the repository's overall documentation. The main Files Changed Analysis
Architecture & Impact Assessment
Workflow VisualizationsequenceDiagram
participant User as Developer
participant PR as Pull Request
participant Workflow as docs-preview.yml
participant DetectJob as Detect Job
participant PreviewJob as Preview Job
participant GitHubAPI as GitHub API
User->>PR: Pushes changes
PR->>Workflow: Triggers on 'opened' or 'synchronize'
Workflow->>DetectJob: Starts
DetectJob->>GitHubAPI: Get changed files
DetectJob->>DetectJob: Match files against 'docs_paths'
alt Docs paths are affected
DetectJob-->>PreviewJob: Proceeds (outputs docs_affected=true)
PreviewJob->>PreviewJob: Checkout base and head commits
PreviewJob->>PreviewJob: Run doc generators for both
PreviewJob->>PreviewJob: Diff generated docs
alt Output has changed
PreviewJob->>GitHubAPI: Post/Update PR comment with diff
PreviewJob->>GitHubAPI: Request team review (if configured)
else Output is identical
PreviewJob->>GitHubAPI: Update comment to "No impact" (if exists)
end
else Docs paths NOT affected
DetectJob-->>Workflow: Skips preview (outputs docs_affected=false)
end
Scope Discovery & Context ExpansionThe changes are contained within the Metadata
Powered by Visor from Probelabs Last updated: 2026-07-21T14:14:52.378Z | Triggered by: pr_updated | Commit: 5b63642 💡 TIP: You can chat with Visor using |
Security Issues (2)
Security Issues (2)
Performance Issues (2)
Powered by Visor from Probelabs Last updated: 2026-07-21T14:14:30.143Z | Triggered by: pr_updated | Commit: 5b63642 💡 TIP: You can chat with Visor using |
Jira Ticket
TT-XXXXX
Description
Adds a reusable
docs-previewworkflow that catches PM feedback on generated documentation at the source-code PR, before the docs are ever synced.Today, config docs and OAS/API-spec docs in
tyk-docsare generated from source repos (Go doc comments,apidef/oasannotations, swagger files) by the exptyk-docs.ymlsync. PMs only see the content once it lands in the generatedtyk-docsPR — and since that content can't be edited there, every PM correction means fixing the source repo, re-running the sync, and re-reviewing a new PR.This workflow closes that loop early: on a PR in a source repo that touches doc-bearing paths, it runs the same generators as the sync against the PR's base and head, and if the rendered output differs, posts the docs diff as a sticky PR comment and requests an advisory review from a configurable PM team. Merges are never blocked, and PMs are never pinged when a change has no documentation impact.
Behavior summary:
docs_paths→ workflow ends silently.docs-preview-diffartifact) plus a one-time advisory review request topm_team.Consumer usage (per repo, with repo-specific paths):
Generation steps (schema-gen flags, swagger Mintlify massage,
tyk-config-info-generatorinvocation, OAS duplicate cleanup) are copied verbatim from exp'styk-docs.ymlso the preview matches what the sync will later produce. Factoring both into shared composite actions is a planned follow-up.Type of Change
Changes Made
.github/workflows/docs-preview.ymlreusable workflow (workflow_call) with two jobs:detect: matches PR-changed files against thedocs_pathsglobs; skips fork PRs.preview: generates docs for base and head percomponent(gateway/dashboard/pump/mdcb/portal), diffs them, uploads the full diff artifact, posts/updates a marker-identified sticky comment, and requests thepm_teamreview once per PR via the PROBE GitHub App token.docs/workflows/docs-preview.md(README source documentation).README.mdviatask gen. The README was stale, so the diff also picks up "Undocumented action" stubs for workflows added since the last regeneration, and dropsGithub to slack/PR Agent, whose source files no longer exist.docs/workflows/s1-cns-scan.mdanddocs/workflows/release-bot.md: these sections had been hand-edited into README only, so regeneration was silently deleting them — their content is now preserved in thedocs/source of truth.docs/superpowers/plans/2026-07-21-docs-preview-adoption/.Testing
config.govsconfig/**), empty input, multi-file PRs.task lint(yamllint + README regeneration) passes; docs lint reports no missing documentation for the new workflow.tykwith the caller pinned to this branch (runbook step 2) exercising the three scenarios (docs diff + one-time PM request / "no documentation impact" flip / silent skip).Checklist
README.md, actiondescriptionfields)shellcheck, used an appropriate shebang and error handling, and preserved required executable permissions (n/a — shell logic is inline in workflow YAML; validated via local bash test harnesses instead)action.ymlinterface, defaults, outputs, and examples as needed